//
//  RichTextMaker.h
//  YanXiuWang
//
//  Created by 慧趣小歪 on 16/12/10.
//  Copyright © 2016年 小分队. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIColor.h>


@class RichTextMaker;

typedef RichTextMaker * (^RICH_TEXT_DIRECTION)(NSWritingDirection direction);
typedef RichTextMaker * (^RICH_TEXT_BREAKMODE)(NSLineBreakMode breakMode);
typedef RichTextMaker * (^RICH_TEXT_BREAKMODE)(NSLineBreakMode breakMode);
typedef RichTextMaker * (^RICH_TEXT_ALIGNMENT)(NSTextAlignment alignment);
typedef RichTextMaker * (^RICH_TEXT_ATTACHMENT)(NSTextAttachment * attachment);
typedef RichTextMaker * (^RICH_TEXT_PARAGRAPH)(NSParagraphStyle * paragraph);
typedef RichTextMaker * (^RICH_TEXT_SHADOW)(NSShadow * shadow);
typedef RichTextMaker * (^RICH_TEXT_STRING)(NSString * text);
typedef RichTextMaker * (^RICH_TEXT_FORMAT)(NSString * format, ...) NS_FORMAT_FUNCTION(1,2);
typedef RichTextMaker * (^RICH_TEXT_COLOR)(UIColor * color);
typedef RichTextMaker * (^RICH_TEXT_LINE)(NSNumber * number, UIColor * color);
typedef RichTextMaker * (^RICH_TEXT_IMG_RECT)(UIImage * image, CGRect bounds);
typedef RichTextMaker * (^RICH_TEXT_IMG)(UIImage * image);
typedef RichTextMaker * (^RICH_TEXT_FONT)(UIFont * font);
typedef RichTextMaker * (^RICH_TEXT_INT)(NSInteger value);
typedef RichTextMaker * (^RICH_TEXT_FLOAT)(CGFloat value);

RichTextMaker * RichText(NSString * text);
FOUNDATION_EXPORT RichTextMaker * RichFormat(NSString * format, ...) NS_FORMAT_FUNCTION(1,2);

@interface RichTextMaker : NSObject

/*   富文本   */
@property (nonatomic, readonly) NSAttributedString *attributedString;


/*  附加图片  */
@property (nonatomic, copy, readonly) RICH_TEXT_IMG image;
/*  附加图片  */
@property (nonatomic, copy, readonly) RICH_TEXT_IMG_RECT imageAndBounds;
/*  附加元素  */
@property (nonatomic, copy, readonly) RICH_TEXT_ATTACHMENT attachment;
/*  文字内容  */
@property (nonatomic, copy, readonly) RICH_TEXT_STRING text;
/*  文字内容  */
@property (nonatomic, copy, readonly) RICH_TEXT_FORMAT format;


/*  文字字体  */
@property (nonatomic, copy, readonly) RICH_TEXT_FONT font;
/*  文字颜色  */
@property (nonatomic, copy, readonly) RICH_TEXT_COLOR textColor;
/*  文字颜色  */
@property (nonatomic, copy, readonly) RICH_TEXT_COLOR backgroundColor;


/*  文字连体  */
@property (nonatomic, copy, readonly) RICH_TEXT_INT ligature;
/*  文字间距  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT kern;
/*  文字宽窄  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT expansion;
/*  文字倾斜  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT obliqueness;
/*  基线偏移  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT baselineOffset;


/*  文本链接  */
@property (nonatomic, copy, readonly) RICH_TEXT_STRING link;
/*  文字阴影  */
@property (nonatomic, copy, readonly) RICH_TEXT_SHADOW shadow;


/*  下划线 (@param1 style, @param2 color) */
@property (nonatomic, copy, readonly) RICH_TEXT_LINE underline;
/*  描边线 (@param1 width, @param2 color) */
@property (nonatomic, copy, readonly) RICH_TEXT_LINE stroke;
/*  删除线 (@param1 style, @param2 color) */
@property (nonatomic, copy, readonly) RICH_TEXT_LINE strikethrough;


/*  段落样式  */
@property (nonatomic, copy, readonly) RICH_TEXT_PARAGRAPH paragraph;
/*  每行间距  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT lineSpacing;
/*  段落间距  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT paragraphSpacing;
/*  文字对齐  */
@property (nonatomic, copy, readonly) RICH_TEXT_ALIGNMENT alignment;
/*  首行缩进  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT firstLineHeadIndent;
/*  非首行缩进  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT headIndent;
/*  尾部缩进  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT tailIndent;
/*  换行模式  */
@property (nonatomic, copy, readonly) RICH_TEXT_BREAKMODE lineBreakMode;
/*  最小行高  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT minimumLineHeight;
/*  最大行高  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT maximumLineHeight;
/*  句子方向  */
@property (nonatomic, copy, readonly) RICH_TEXT_DIRECTION baseWritingDirection;
/*  行高乘因  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT lineHeightMultiple;
/*  段前空格  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT paragraphSpacingBefore;
/*  连笔字值  */ // 0 ~ 1
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT hyphenationFactor;
/*  Tab间隔  */
@property (nonatomic, copy, readonly) RICH_TEXT_FLOAT defaultTabInterval;


/*  书写方向 (NSWritingDirection | NSWritingDirectionFormatType) */
@property (nonatomic, copy, readonly) RICH_TEXT_DIRECTION direction;
/*  排版方向 iOS 无效 */
@property (nonatomic, copy, readonly) RichTextMaker * vertical;
/*  文字凸起  */
@property (nonatomic, copy, readonly) RichTextMaker * effectLetterpress;


@end
